home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Shareware City / Developers / VideoToolbox / 7500⁄8500 driver.doc next >
Encoding:
Text File  |  1995-10-26  |  7.2 KB  |  140 lines  |  [TEXT/R*ch]

  1. Sent:        10/24 (edited by dgp to incorporate subsequent additions)
  2. From:        Fernando Urbina, nano@apple.com
  3. To:          Denis Pelli, denis@cns.nyu.edu
  4. Enclosure:   7500/8500 Graphics Driver
  5.  
  6. Denis,
  7.  
  8. I'm enclosing a file that contains a revised version of the Graphics Driver for
  9. the Power Macintosh 7500 and 8500.  Its version is 1.3f1. This has the following
  10. new resolutions:
  11.  
  12. 1. For the Apple Multiscan 17" and 20", a new resolution of 640x480 at 120 Hz is
  13. available through the Sounds & Displays Control Panel. It will not show up on the
  14. Control Strip.
  15.  
  16. 2. For the Multiscan 17" and 20", different refresh rates are available to be
  17. used while filming the display.  Those rates are 59.94 Hz (NTSC), 50 Hz (PAL),
  18. and 48 Hz (film).  Of course, a display that syncs to those refresh rates is
  19. required. The Apple Multiscan 17" and 20" will NOT sync to 48 Hz.
  20.  
  21. 3. (Added by dgp) Any application can control the display resolution by using
  22. Apple's new Display Manager: DMCheckDisplayMode and DMSetDisplayMode. You may
  23. also want to use GDVideo.c:GDGetDisplayMode to record what the resolution was
  24. before you change it, so you can restore it when you're done. Try the TimeVideo
  25. demo, asking it to test all the resolutions.
  26.  
  27. 4. (Added by dgp) Denis asks, "The 640x480x120 Hz mode on my Apple 17" multiscan
  28. is great. Rock solid. But the image isn't centered; about 10 pixels worth fall
  29. off the left edge of the screen. Can this be fixed?" Fernando replies, "Can you
  30. just adjust the controls on the monitor to move the image to the right? This
  31. would be the easiest solution and is what I had to do. The better solution
  32. (requiring a new version of the driver) is to adjust the horizontal parameters so
  33. that the display puts it close to the middle, but that'll take some doing."
  34.  
  35. The "7500/8500 Graphics Driver" file should be placed in the extensions folder.
  36.  
  37. Please do not give it wide distribution before you test it some. I have, but you
  38. never know. After that, it will, of course, NOT be supported by Apple. I will
  39. support it as long as time permits.
  40.  
  41. - Fernando
  42.  
  43. p.s. Fernando also documented a pair of private status and control video driver
  44. calls for the 7500/8500 driver that can disable waiting for VBL's and control how
  45. long the driver waits for the CLUT to settle after writing each entry in the
  46. CLUT. Fernando's documentation of the calls appears next to my implementation of
  47. access routines, GDSetDelay and GDGetDelay, in GDVideo.c. Documentation of how to
  48. use GDSetDelay and GDGetDelay appears at the top of GDVideo.c. (I've pasted a
  49. copy below.) Try running the TimeVideo demo. It allows you to enter any values
  50. you like, and they persist until reboot.
  51.  
  52.     OSErr GDSetDelay(GDHandle device,Boolean dontWaitForVBL,double nanoseconds);
  53.     OSErr GDGetDelay(GDHandle device,Boolean *dontWaitForVBLPtr,double *nanosecondsPtr);
  54. These two routines (in VideoToolbox:GDVideo.c) support features, i.e.
  55. cscSetTimeDelays and cscGetTimeDelays, unique to the built-in video driver of the
  56. PowerMac 7500 and 8500. Both routines will merely return innocuous errors (-17
  57. and -18) if used with any other video driver. Like most video drivers, the
  58. 7500/8500 video driver normally waits for VBL when loading the CLUT, but this can
  59. be overriden by the Boolean parameter dontWaitForVBL, in which case, from then on
  60. (until it's changed again or the machine is rebooted) the driver will load the
  61. CLUT immediately when it's called, without waiting for VBL. The second feature is
  62. that the video driver normally waits 800 ns after loading each RGB triplet to the
  63. CLUT, "to allow for the CLUT to settle and increment its address", and that time
  64. can be set by the parameter "nanoseconds". GDGetDelay() allows you to read the
  65. current setting of both parameters. GDSetDelay() allows you to set both
  66. parameters. If the supplied value of "nanoseconds" is infinite or NAN then it's
  67. ignored and only "dontWaitForVBL" is set. The 7500/8500 video driver was written
  68. by Apple Engineer Fernando Urbina, nano@apple.com. GDSetDelay() and GDSetDelay()
  69. were written by Denis Pelli, to allow convenient access to Fernando's custom
  70. control and status driver calls. Note that Fernando Urbina has also supplied a
  71. newer version of this driver (included in the VideoToolbox) that supports several
  72. extra resolutions, of which the most noteworthy is 640x480x120 Hz, which works
  73. well on the Apple 17" Multiscan.
  74.  
  75. Thus far, using visual inspection in TimeVideo, I've been unable to notice any
  76. bad effects of not waiting for VBL and reducing the waiting interval from 800 ns
  77. to zero. I asked Fernando Urbina, nano@apple.com, about it, since he put in the
  78. delays because he "does indeed get artifacts when updating the CLUT if we don't
  79. suppress interrupts while updating it." What were the artifacts? Fernando
  80. replies, "The delays are there because of hardware requirements:  When writing to
  81. the CLUT in a self-incrementing mode the hardware requires 800ns to update the
  82. address counter.  Of course, this is worst case.  ( We write the CLUT starting
  83. address and then the R, G, and B.  At the end of the B, the address counter for
  84. the CLUT will automatically increment to the next address.) I noticed some
  85. artifacts when doing palette animation -- one of the After Dark modules showed
  86. this very well."
  87.  
  88. Received:    10/24
  89. From:        Fernando Urbina, nano@apple.com
  90. To:          Denis Pelli, denis@cns.nyu.edu
  91.  
  92. The following is the information on the private call for the 7500 and the 
  93. 8500 to disable waiting for VBL's and to change the time that we wait for 
  94. the CLUT to settle after writing each entry in the CLUT.  As shipped, the 
  95. driver waits for 800 nanoseconds after writing each RGB triplet, to allow 
  96. the hardware to increment the CLUT address.
  97.  
  98. cscSetTimeDelays is used to set some flags and time delays used to write the
  99. CLUT. Use PBControl to issue the call, with the csParam[0] containing a pointer
  100. to a VDTimeDelay structure. Set the "validMask" field with the bits
  101. indicating which parameters you want to set.
  102.  
  103. cscGetTimeDelays is used to examine the current values of the flags and time
  104. delays. Use PBStatus instead of PBControl. Set the "validMask" field
  105. with the bits indicating which parameters you want to get.
  106.  
  107. The following is the definition of the fields of the VDTimeDelay struct:
  108.  
  109. flags, bit 0:  DontWaitForVBL flag:  When false, it means that the driver should
  110. wait for a VBL before writing the CLUT.  When true, the driver should NOT wait
  111. for a VBL.
  112.  
  113. flags, bit 1:  SetCLUTAddrRegTiming flag:  When false, use the default timing.
  114. When true, use paramOne and paramTwo to specify the delay in nanoseconds.
  115.  
  116. validMask: Specifies which bits in flags are valid.  Bits are valid when
  117. corresponding bit position is 1.
  118.  
  119. paramOne,paramTwo: When the SetCLUTAddrRegTiming bit of the validMask is set,
  120. then these fields specify the delay, in nanoseconds: nanoseconds.hi in paramOne
  121. and nanoseconds.lo in paramTwo.  See Designing PCI Cards & Drivers for the
  122. Nanoseconds data structure.
  123.  
  124. enum{cscSetTimeDelays = 141};    // Used to set the different time delays
  125. enum{cscGetTimeDelays = 141};
  126. enum{gDontWaitForVBLMask=1,gSetCLUTTimingMask=2};
  127. #if PRAGMA_ALIGN_SUPPORTED || __MWERKS__
  128.     #pragma options align=mac68k
  129. #endif
  130. struct VDTimeDelays{
  131.     UInt32 flags;
  132.     UInt32 validMask;
  133.     UInt32 paramOne;
  134.     UInt32 paramTwo;
  135. };
  136. typedef struct VDTimeDelays VDTimeDelays;
  137. #if PRAGMA_ALIGN_SUPPORTED || __MWERKS__
  138.     #pragma options align=reset
  139. #endif
  140.